/**
 * Created by on 2017/5/8.
 */
import React, {Component} from 'react';
import {
    StyleSheet,
    View,
    Modal,
    Button,
    Alert,Text
} from 'react-native';
import DialogUtils from '../Common/LoginPopup'

export default class ModalDemo extends Component {

    static navigationOptions = {
        title: 'Modal',
    };

    state = {
        visible: false,
        transparent: true,
    }

    render() {

        let dialog = this.state.visible?<DialogUtils isShow={this.state.visible} dismiss={()=>this.setState({visible:false})}/>:null

        return (
            <View style={{flex:1}}>
                {dialog}
                <Button title='显示Modal' onPress={()=>{this.setState({visible:true})}}/>
                <Button title='隐藏Modal' onPress={()=>{this.setState({visible:false})}}/>
            </View>
        );
    }

}